@import (reference) "lib/bootstrap_mixins.less";
@import (reference) "lib/mixins";
@import (reference) "lib/variables";

.sidebar {
  width: @sidebar_width - 1;
  border-right: 1px solid #989898;
  border-left: 1px solid #989898;
  float: left;
  position: absolute;
  top: @header_height + 26;
  left: 0px;
  bottom: 33px;
  overflow-y: scroll;
  overflow-x: hidden;

  .check-box { width: 20px; text-align: center; }
  .color-box { width: 32px; }
  .truncate {
    display: block;
    width: 220px;
    .ellipsis();
    .prevent-text-breakouts();
  }
  input[type='checkbox'] {
    margin: auto;
    display: block;
  }

  .colorpicker-input {
    opacity: 0;
    width: 100%;
    height: 20px;
    cursor: pointer;
    margin:0 !important;
    padding:0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: none !important;
    .transition(none);
  }
}

.tabbar {
  @height : 24px;
  width: @sidebar_width - 1;
  background: #ffffff;
  background: -moz-linear-gradient(top,  #ffffff 0%, #ffffff 23%, #f4f4f4 54%, #ececec 62%, #ededed 100%);
  background: -webkit-linear-gradient(top,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
  background: -o-linear-gradient(top,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
  background: linear-gradient(to bottom,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
  height: @height;
  font-size: 14px;
  line-height: @height;
  border-bottom: 1px solid #b6b6b6;
  .box-shadow(inset 0 -1px #f4f4f4);
  font-family: @systemFontFamily;
  position: fixed;
  font-weight: bold;
  border-right: 1px solid #989898;
  border-left: 1px solid #989898;
  text-align: center;
  font-size: 0;

  a {
    color: #333;
    font-weight: 600;
    padding: 0;
    border-right: 1px solid #989898;
    text-decoration: none;
    font-size: 13px;
    display: block;
    float: left;
    line-height: 25px;
    width: 33.33%;
    .box-sizing(border-box);

    &:last-child {
      border-right: 0px solid #989898;
    }

    &.active {
      background-color: rgba(0,0,0,.2);
      .box-shadow(inset 0 0 3px rgba(0,0,0,.2));
    }
  }
}

.titlebar {
  @height : 24px;
  width: @sidebar_width - 1;
  background: #ffffff;
  background: -moz-linear-gradient(top,  #ffffff 0%, #ffffff 23%, #f4f4f4 54%, #ececec 62%, #ededed 100%);
  background: -webkit-linear-gradient(top,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
  background: -o-linear-gradient(top,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
  background: linear-gradient(to bottom,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
  height: @height;
  font-size: 14px;
  line-height: @height;
  border-bottom: 1px solid #b6b6b6;
  .box-shadow(inset 0 -1px #f4f4f4);
  font-family: @systemFontFamily;
  position: fixed;
  font-weight: bold;
  border-right: 1px solid #989898;

  .actions {
    @width: 29px;
    .user-select(none);
    .add {
      position: absolute;
      top:0;
      border-left: 1px solid #b6b6b6;
      width: @width;
      height: @height;
      text-align: center;
      cursor: pointer;
      background-position: center center;
      background-repeat: no-repeat;
      color: #333;
      font-size: 8px;
      line-height: @height + 2px;
      right: @width + 1;

      &:active, &.active {
        background-color: rgba(0,0,0,.2);
        .box-shadow(inset 0 0 3px rgba(0,0,0,.2));
      }
    }
  }
}

.actionbar {
  #gradient > .vertical(#e8e8e8, #c2c2c2);
  border: 1px solid #969696;
  border-bottom: 0px;
  .box-shadow(inset 0 1px 0 #f5f5f5);
  position: fixed;
  bottom: 0px;
  height: 32px;
  width: 399px;
  z-index: 99;

  .search {
    &:after {
      content: "\e002";
      display: block;
      position: absolute;
      top: 9px;
      left: 13px;
      z-index: 999999;
      width: 16px;
      height: 16px;
      font-size: 13px;
      opacity: 0.75;
      font-family: "tmthemeeditor" !important;
      font-style: normal !important;
      font-weight: normal !important;
      font-variant: normal !important;
      text-transform: none !important;
      speak: none;
      line-height: 1;
      color: #333;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      .scale(1.25);
      display: inline-block;
    }

    .clear_search {
      right: auto;
      left: 297px;
      font-size: 13px;
      line-height: 18px;
    }

    input[type="search"] {
      border-radius: 4px;
      box-shadow: 0 1px 2px rgba(0,0,0,.05);
      border-color: #989898;
      margin: 3px 6px;
      font-size: 13px;
      line-height: 16px;
      height: 16px;
      width: 280px;
      padding-left: 24px;

      &:-moz-placeholder {
        line-height: 16px;
        color: #bbb;
      }
      &:-ms-input-placeholder {
        line-height: 16px;
        color: #bbb;
      }
      &::-webkit-input-placeholder {
        line-height: 16px;
        color: #bbb;
      }

    }
  }
  .actions {
    @width: 36px;
    @height: 32px;
    position: absolute;
    top:0;
    right: 0;
    .user-select(none);

    .add, .remove {
      position: absolute;
      top:0;
      border-left: 1px solid #b6b6b6;
      width: @width;
      height: @height;
      text-align: center;
      cursor: pointer;
      background-position: center center;
      background-repeat: no-repeat;
      color: #333;
      font-size: 8px;
      line-height: @height + 2px;

      &:active:not(.disabled), &.active:not(.disabled) {
        background-color: rgba(0,0,0,.2);
        .box-shadow(inset 0 0 3px rgba(0,0,0,.2));
      }
    }
    .open .add {
      background-color: rgba(0,0,0,.2);
      .box-shadow(inset 0 0 3px rgba(0,0,0,.2));
    }
    .add {
      right:0;
      border-left: 1px solid #b6b6b6;

      &.disabled {
        opacity: 0.3;
      }

    }
    .remove {
      right: @width + 1;
      border-left: 1px solid #b6b6b6;

      &.disabled {
        opacity: 0.3;
      }
    }
  }

}

.list {
  font-family: @monoFontFamily;
  width: 100%;

  &.general {
    thead {border-top: 0;}
  }

  &.info {
    td {
      vertical-align: top;
    }

    input[type='text'], textarea {
      width: 290px;
      margin-bottom: 0;
      padding: 2px 4px;
    }

    .name-box input[type='text'] {
      width: 65px;
    }
  }

  textarea {
    resize:vertical;
  }

  .gcolor-text-input {
    height: 16px;
    padding: 2px 4px;
    border-radius: 0;
    width: 70px;
    margin: 0;
    font-family: @monoFontFamily;
    font-size: 12px;
  }

  thead {
    background: #ffffff;
    background: -moz-linear-gradient(top,  #ffffff 0%, #ffffff 23%, #f4f4f4 54%, #ececec 62%, #ededed 100%);
    background: -webkit-linear-gradient(top,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
    background: -o-linear-gradient(top,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
    background: linear-gradient(to bottom,  #ffffff 0%,#ffffff 23%,#f4f4f4 54%,#ececec 62%,#ededed 100%);
    height: 15px;
    font-size: 11px;
    line-height: 15px;
    border-bottom: 1px solid #b6b6b6;
    .box-shadow(inset 0 -1px #f4f4f4);

    th {
      font-weight: normal;
      font-family: @systemFontFamily;
      &.align-begin {padding-left: 6px;}
    }

    tr {
      border-top: 0px solid #969696;
      border-bottom: 1px solid #969696;
    }
  }

  td {
    position: relative;
    .user-select(none);

    &.name-box {
      padding-left: 6px;
      font-size: 15px;
      line-height: 22px;
    }
  }

  & td.name-box {
    cursor:pointer;
  }

  tr {
    padding: 1px 0;
  }

  .hovered {
    background: fadeout(#00aa25, 85);

    td:last-child {
      box-shadow: inset -4px 0 0 #00aa25;
    }
  }

}

.colorpicker-box {
  top: 1px;
  bottom: 1px;
  left: 1px;
  right: 1px;
  border: 1px solid rgba(255,255,255,.33);
  position: absolute;
  background-image: url();
  .background-clip(padding-box);

  &.has_color {
    .background-clip(border-box);
    background-image: none;
  }
}

::-webkit-color-swatch-wrapper {
  padding: 0;
}
::-webkit-color-swatch {
  border: none;
}

.ui-sortable-placeholder {
  height: 23px;
}

.current_theme_light .selected {
  background-image: linear-gradient(to top, rgba(0,0,0,.2) 0%, rgba(0,0,0,0) 60%);
}

.current_theme_dark .selected {
  background-image: linear-gradient(to bottom, rgba(255,255,255,.2) 0%, rgba(255,255,255,0) 60%);
}
